import requests

# host = "127.0.0.1"  # PC本地
host = "116.62.130.29" # 服务器

# 测试hello接口
def try_hello():
    url = f"http://{host}:9115"
    response = requests.get(url)
    print(response.text)

# 测试count_text接口
def try_count_text():
    url = f"http://{host}:9115/count_text"
    data = {"text": "Hello, World!"}
    print(requests.post(url, json=data).json())

# 测试current_time接口
def try_current_time():
    level = 2
    url = f"http://{host}:9115/current_time?level={level}"
    print(requests.get(url).json())

if __name__ == "__main__":
    try_hello()
    try_count_text()
    try_current_time()